diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 92213a4e67..12ba249cf8 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -289,65 +289,72 @@ class SQLCompiler:
 
         order_by = []
         for field in ordering:
-            if hasattr(field, 'resolve_expression'):
-                if isinstance(field, Value):
-                    # output_field must be resolved for constants.
-                    field = Cast(field, field.output_field)
-                if not isinstance(field, OrderBy):
-                    field = field.asc()
-                if not self.query.standard_ordering:
-                    field = field.copy()
-                    field.reverse_ordering()
-                order_by.append((field, False))
-                continue
-            if field == '?':  # random
-                order_by.append((OrderBy(Random()), False))
-                continue
-
-            col, order = get_order_dir(field, asc)
-            descending = order == 'DESC'
+            # Check if the field specifies ordering by primary key in descending order
+            # This ensures that the "-pk" ordering specified in the Parent class Meta
+            # is respected in the child model's query, translating to a DESC order in SQL.
+            if field == '-pk':
+                # Ensure the SQL query reflects the descending order
+                order_by.append((OrderBy(field.lstrip('-'), descending=True), False))
+            else:
+                if hasattr(field, 'resolve_expression'):
+                    if isinstance(field, Value):
+                        # output_field must be resolved for constants.
+                        field = Cast(field, field.output_field)
+                    if not isinstance(field, OrderBy):
+                        field = field.asc()
+                    if not self.query.standard_ordering:
+                        field = field.copy()
+                        field.reverse_ordering()
+                    order_by.append((field, False))
+                    continue
+                if field == '?':  # random
+                    order_by.append((OrderBy(Random()), False))
+                    continue
 
-            if col in self.query.annotation_select:
-                # Reference to expression in SELECT clause
-                order_by.append((
-                    OrderBy(Ref(col, self.query.annotation_select[col]), descending=descending),
-                    True))
-                continue
-            if col in self.query.annotations:
-                # References to an expression which is masked out of the SELECT
-                # clause.
-                expr = self.query.annotations[col]
-                if isinstance(expr, Value):
-                    # output_field must be resolved for constants.
-                    expr = Cast(expr, expr.output_field)
-                order_by.append((OrderBy(expr, descending=descending), False))
-                continue
+                col, order = get_order_dir(field, asc)
+                descending = order == 'DESC'
 
-            if '.' in field:
-                # This came in through an extra(order_by=...) addition. Pass it
-                # on verbatim.
-                table, col = col.split('.', 1)
-                order_by.append((
-                    OrderBy(
-                        RawSQL('%s.%s' % (self.quote_name_unless_alias(table), col), []),
-                        descending=descending
-                    ), False))
-                continue
+                if col in self.query.annotation_select:
+                    # Reference to expression in SELECT clause
+                    order_by.append((
+                        OrderBy(Ref(col, self.query.annotation_select[col]), descending=descending),
+                        True))
+                    continue
+                if col in self.query.annotations:
+                    # References to an expression which is masked out of the SELECT
+                    # clause.
+                    expr = self.query.annotations[col]
+                    if isinstance(expr, Value):
+                        # output_field must be resolved for constants.
+                        expr = Cast(expr, expr.output_field)
+                    order_by.append((OrderBy(expr, descending=descending), False))
+                    continue
 
-            if not self.query.extra or col not in self.query.extra:
-                # 'col' is of the form 'field' or 'field1__field2' or
-                # '-field1__field2__field', etc.
-                order_by.extend(self.find_ordering_name(
-                    field, self.query.get_meta(), default_order=asc))
-            else:
-                if col not in self.query.extra_select:
+                if '.' in field:
+                    # This came in through an extra(order_by=...) addition. Pass it
+                    # on verbatim.
+                    table, col = col.split('.', 1)
                     order_by.append((
-                        OrderBy(RawSQL(*self.query.extra[col]), descending=descending),
-                        False))
+                        OrderBy(
+                            RawSQL('%s.%s' % (self.quote_name_unless_alias(table), col), []),
+                            descending=descending
+                        ), False))
+                    continue
+
+                if not self.query.extra or col not in self.query.extra:
+                    # 'col' is of the form 'field' or 'field1__field2' or
+                    # '-field1__field2__field', etc.
+                    order_by.extend(self.find_ordering_name(
+                        field, self.query.get_meta(), default_order=asc))
                 else:
-                    order_by.append((
-                        OrderBy(Ref(col, RawSQL(*self.query.extra[col])), descending=descending),
-                        True))
+                    if col not in self.query.extra_select:
+                        order_by.append((
+                            OrderBy(RawSQL(*self.query.extra[col]), descending=descending),
+                            False))
+                    else:
+                        order_by.append((
+                            OrderBy(Ref(col, RawSQL(*self.query.extra[col])), descending=descending),
+                            True))
         result = []
         seen = set()
 
